package cn.edu.nbpt.campus_api.model;

public enum ErrorCode {

    /**
     * 异常分类种类、粒度看项目需要设定，无定论
     */
    // 枚举值需放第一行
    SUCCESS(200, "操作成功"),
    ERROR(500, "操作失败"),
    INSERT_ERROR(501, "插入失败"),
    UPDATE_ERROR(502, "更新失败"),
    DELETE_ERROR(503, "删除失败"),
    SELECT_ERROR(504, "查询失败"),
    FILE_OPERATE_ERROR(505, "文件操作失败"),
    TOKEN_INVALIDATE(50008, "token失效"),
    PARAMETER_VALIDATE_ERROR(509, "参数校验失败"),
    DELETE_BAN_ERROR(510, "班级学生列表不为空，请删除学生后再删除班级");
    private Integer code;

    private String msg;

    ErrorCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
